package edu.cmu.cs.stage3.alice.core.question.list;

import edu.cmu.cs.stage3.alice.core.List;
import edu.cmu.cs.stage3.alice.core.property.ListProperty;

public abstract class ListObjectQuestion extends edu.cmu.cs.stage3.alice.core.Question {
	public final ListProperty list = new ListProperty( this, "list", null );
	protected abstract Object getValue( List list );
	//Rem @Override
	public Class getValueClass() {
		List listValue = list.getListValue();
		if( listValue!=null ) {
			return listValue.valueClass.getClassValue();
		} else {
			//todo?
			return Object.class;
		}
	}
	//Rem @Override
	public Object getValue() {
		List listValue = list.getListValue();
		if( listValue!=null ) {
			return getValue( listValue );
		} else {
			return null;
		}
	}
}